import Taro, { Component } from '@tarojs/taro';
import { View, Text, Button } from '@tarojs/components';
import BG from '../../static/goods-detail/bg.png';
import { set as setGlobalData, get as getGlobalData } from '../../utils/globalData';
import './index.scss';
import { fullImgUrl } from '../../utils/utils';
import iconshop from '../../static/public/icon-close.png';

export default class Index extends Component {

  config = {
    navigationBarTitleText: ''
  }

  state = {
    setting: null,
  }

  componentWillMount() {
    this.setState({
      setting: Taro.getStorageSync('setting')
    })
  }
  componentDidMount() { }
  componentWillReceiveProps(nextProps, nextContext) { }
  componentWillUnmount() { }
  componentDidShow() { }
  componentDidHide() { }
  componentDidCatchError() { }
  componentDidNotFound() { }

  close() {
    this.props.onClose();
  }

  render() {
    const { setting } = this.state;
    return (
      <View className="container">
        <Image onClick={this.close} className="colse-card" src={iconshop} />
        {setting && <Image mode="widthFix" src={fullImgUrl(setting.home_tip)} className="bg" />}
      </View>
    );
  }
}
